/*******************************************************************************
 * Copyright (c) 2002 Boris Pruessmann and others. All rights reserved. This
 * program and the accompanying materials are made available under the terms of
 * the Common Public License v0.5 which accompanies this distribution, and is
 * available at http://www.eclipse.org/legal/cpl-v05.html
 * 
 * Contributors: Boris Pruessmann - Initial implementation.
 ******************************************************************************/
package net.sourceforge.perforce.core.resources;

import java.util.Date;

import net.sourceforge.perforce.core.api.IPerforceServer;

/**
 * This interface describes a Perforce Changelist.
 * 
 * @version $Revision: 488 $
 * @author <a href="mailto:bpruessmann@users.sourceforge.net">Boris
 *         Pruessmann</a>
 */
public interface IChangelist {
  //----------------------------------------------------------------------------
  // ------- Constants

  /** Constant specifying the magic id of the default changelist. */
  Integer DEFAULT = new Integer(-1);
  /** Status for pending changelists. */
  String STATUS_PENDING = "pending"; //$NON-NLS-1$
  /** Status for submitted changelists. */
  String STATUS_SUBMITTED = "submitted"; //$NON-NLS-1$

  //----------------------------------------------------------------------------
  // --------- Methods

  /**
   * Call this method to retrieve the changelist's id.
   * 
   * @return the changelist id.
   */
  Integer getId();

  /**
   * Returns the name of the client to which this changelist belongs.
   * 
   * @return the clientname.
   */
  String getClientName();

  /**
   * Call this method to retrieve the name of the user to which the changelist
   * belongs.
   * 
   * @return the user name.
   */
  String getUserName();

  /**
   * Returns the date of submission.
   * 
   * @return the date of submission.
   */
  Date getDate();

  /**
   * Call this method to retrieve the changelist's description.
   * 
   * @return the description.
   */
  String getDescription();

  /**
   * Call this method to retrieve the changelist's status.
   * 
   * @return either STATUS_PENDING or STATUS_SUBMITTED.
   */
  String getStatus();

  /**
   * Retrieves the files that belong to the changelist.
   * 
   * @return array of files.
   */
  IP4File[] getFiles();

  /**
   * Call this method to retrieve the server to which the Changelist belongs.
   * 
   * @return the perforce server.
   */
  IPerforceServer getServer();

  public void setDescription(String description);
}
